package three;

import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;

import com.sun.jdmk.comm.HtmlAdaptorServer;

public class HelloAgent {
	
	public static void main(String[] args) throws Exception {
		
		MBeanServer server = MBeanServerFactory.createMBeanServer();
		ObjectName helloName = new ObjectName("liuys:name=HelloDynamic");
		HelloDynamic hello = new HelloDynamic();
		server.registerMBean(hello, helloName);
		
		ObjectName adapterName = new ObjectName("HelloAgent:name=htmladapter,port=8082");
		HtmlAdaptorServer adaptor = new HtmlAdaptorServer();
		server.registerMBean(adaptor, adapterName);
		adaptor.start();
		System.out.println("start..............");
	}

}
